<%@ include file="/WEB-INF/views/commons/header.jsp" %>
<%@ include file="/WEB-INF/views/commons/menu.jsp" %>
<!-- START BODY -->
<link href="<pc:GetUrlUriTags value="/resources/css/search/search.css" />" media="screen" rel="stylesheet" type="text/css" />
<table class="topSubject" width="100%" border="0">  
  <tr>
    <td height="30px"  width="34px">
    	<img alt="" src="<pc:GetUrlUriTags value="/resources/image/icons/png_apps/32x32/cloud-1.png" />" style="text-decoration: none; border-width: 0px;">
    </td>
    <td height="30px" align="left">
    	<div>
			<strong><a href="<pc:GetUrlUriTags value="/security/user/register/list" />" class="topSubjectText">
			&nbsp; User lists			
			</a></strong>
		</div>
    </td>
    <td align="right">
    	<a href="<pc:GetUrlUriTags value="/security/user/register/create" />" class="button round blue image-right ic-right-add">Add User</a> 
    </td>
  </tr>
</table>

<link href="<pc:GetUrlUriTags value="/resources/kendoui.web.2013.2.716/content/shared/styles/examples-offline.css" />" rel="stylesheet" />
<link href="<pc:GetUrlUriTags value="/resources/kendoui.web.2013.2.716/styles/kendo.common.css" />" rel="stylesheet" />
<link href="<pc:GetUrlUriTags value="/resources/kendoui.web.2013.2.716/styles/kendo.default.css" />" rel="stylesheet" />
<script src="<pc:GetUrlUriTags value="/resources/kendoui.web.2013.2.716/js/jquery.min.js" />" ></script>
<script src="<pc:GetUrlUriTags value="/resources/kendoui.web.2013.2.716/js/kendo.web.js" />" ></script>
<script src="<pc:GetUrlUriTags value="/resources/kendoui.web.2013.2.716/content/shared/js/console.js" />" ></script>
	<div id="example" class="k-content">
            <div id="grid"></div>
            
            <script>
				
				$(document).ready(function() {
					fnSearch();
					//alert("already !!!");			 	
                });
                				
            	function fnSearch(){
                	
                	var dataSource_p = getDataSource();
					GridBuilding(dataSource_p);
					adjuestScreen();		
                }

                function getDataSource() {				
					var url_p = "<pc:GetUrlUriTags value='/security/user/register/users/list/json' />";
                	var  dataSource = new kendo.data.DataSource({
                         type: "json",
                         transport: {
                         	read: {
                             		url : url_p,
                             		dataType: "json"
                            }
                         },
                         schema: {
                             model: {
                                 fields: {
                                	 pkId: { type: "string" },
                                	 userLogin: { type: "string" },
                                	 titleName: { type: "string" },
                                	 firstName: { type: "string" },
                                	 lastName: { type: "string" },
                                	 expiredDate: { type: "string" },
                                	 statusText: { type: "string" }                                	 
                                 }
                             }
                         },
                         pageSize: 200,
                         serverPaging: false,
                         serverFiltering: false,
                         serverSorting: false,
                         reorderable: true,
                         resizable: true
                     });
					 return dataSource;
                }
				
				function GridBuilding(dataSource_p){
					var grid = $("#grid").kendoGrid({
                        dataSource: dataSource_p,
                        height: 430,                        
                        scrollable: true,
                        sortable: true,
                        filterable: true,
                        reorderable: true,
                        resizable: true,
                        pageable: {
                        	refresh: true,
                            input: true,
                            numeric: false
                        },
                        columns: [
									{ field:"pkId", title:"Edit/Del" , 
													template: "<a href='<pc:GetUrlUriTags value='/security/user/register/edit?pkId=#: pkId #' />' style='text-decoration: none;' target='_blank' class='button round red image-right ic-right-edit' >&nbsp;Edit&nbsp;</a> &nbsp; <a href='<pc:GetUrlUriTags value='/security/user/register/delete?pkId=#: pkId #' />' style='text-decoration: none;' class='button round yellow image-right ic-right-delete' >Delete</a>", 
													width: 150, 
													filterable: false 
									},
									{ field:"userLogin", template: "<strong>#: userLogin # </strong>", width: 200, filterable: true },
									{ field:"titleName", width: 200, filterable: true },
									{ field:"firstName", width: 200, filterable: true },
									{ field:"lastName", width: 200, filterable: true },
									{ field:"expiredDate", width: 200, filterable: true },
									{ field:"statusText", width: 200, filterable: true }
                        ]
                    });
					
					grid.refresh();
				}
            </script>
        </div>
</div>

<!-- END BODY -->
<%@ include file="/WEB-INF/views/commons/footer_backlogs.jsp" %>